import pandas as pd
import numpy as np
import random

def creat_csv001():
    adict = dict()
    alist = ['delta1', 'delta2', 'delta3', 'delta4', 'delta5']  # 行标签  # 即一行代表一个成员
    blist = [f'param{i}' for i in range(10)]                    # 列标签  # 每个成员都具有这些属性
    for key in alist:
        # adict[key] = np.array([np.random.rand() for _ in range(10)])    # 每个成员的数据
        a = []
        for i in range(10):
            a.append([random.randint(1,10), random.randint(1,10)])
            print(a)
        adict[key] = a

    df = pd.DataFrame(adict, index=blist)
    df = pd.DataFrame(df.values.T, index=df.columns, columns=df.index)  # 转置表格
    # df.to_csv('out.csv', index = False)  #false 表示不加序号
    df.to_csv('out.csv')  #false 表示不加序号

if __name__ == '__main__':
    creat_csv001()




















